"""
pvis/materials.py
Defines some materials which can be used with the shapes.

Written By:
    James Thomas
    Email: jim@houseoftechnology.org
    Web: http://mission-cognition.houseoftechnology.org/

Copyright 2009-2012

This file is part of the PandaODElib distribution.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 3 of
the License, or (at your option) any later version. The text of the
GNU Lesser General Public License is included with this library in
the file named LICENSE.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
"""

import sys
import os

from pandac.PandaModules import Texture


if hasattr(sys,'frozen') and (sys.frozen=="windows_exe" or sys.frozen=="console_exe"):
    _resourcePath="pvis\\resources\\"
else:
    import os
    _resourcePath = os.path.split( __file__ )[0] + "/resources/"
    del os
del sys

def wood():
    tex = loader.loadTexture(_resourcePath + 'wood.tga')
    tex.setWrapU(Texture.WMRepeat)
    tex.setWrapV(Texture.WMRepeat) #WMClamp)
    return tex

def earth():
    tex = loader.loadTexture(_resourcePath + 'BlueMarble.tga')
    tex.setWrapU(Texture.WMRepeat)
    tex.setWrapV(Texture.WMRepeat) #WMClamp)
    return tex

def bricks():
    tex = loader.loadTexture(_resourcePath + 'brickbump.tga')
    tex.setWrapU(Texture.WMRepeat)
    tex.setWrapV(Texture.WMRepeat) #WMClamp)
    return tex

def random():
    tex = loader.loadTexture(_resourcePath + 'random.tga')
    tex.setWrapU(Texture.WMRepeat)
    tex.setWrapV(Texture.WMRepeat) #WMClamp)
    return tex

def turbulence():
    tex = loader.loadTexture(_resourcePath + 'turbulence3.tga')
    tex.setWrapU(Texture.WMRepeat)
    tex.setWrapV(Texture.WMRepeat) #WMClamp)
    return tex

def plastic():
    return None
